//
//  BasicInfoDataSource.m
//  YinHang
//
//  Created by apple on 14-9-22.
//  Copyright (c) 2014年 孙彦鹏. All rights reserved.
//

#import "BasicInfoDataSource.h"

@implementation BasicInfoDataSource



+(void)basicInfoDataInit{
    NSString *filePath = [PATH_FOR_DOCUMENT stringByAppendingPathComponent:USERFILE];
    
    NSFileManager *fm = [NSFileManager defaultManager];
    
    if (![fm fileExistsAtPath:filePath]) {
        [fm changeCurrentDirectoryPath:[filePath stringByExpandingTildeInPath]];
        //初始化文件
        NSData *d=[[NSData alloc] init];
        [fm createFileAtPath:filePath contents:d attributes:nil];
        
        NSArray *arr1=[[NSArray alloc]initWithObjects:ACCOUNTNUMBER,ENTERPRISENAME,BUSINESSENTITY,LINKMAN,ADDRESS,PHONE,TEL,QQ1,QQ2,QQ3,WEBNAME,WEBLOGO,WEBINTRO,WEBLINK,STATUS,nil];
        NSArray *arr2=[[NSArray alloc]initWithObjects:@"1234567" ,@"引航",@"牛经理",@"杨经理",@"裕华路育才街",@"7654321" ,@"12345678900",@"123",@"456",@"789" ,@"引航网",@"placeholder",@"新闻网站" ,@"1234567890" ,@"良好",nil];
        
        NSMutableDictionary *bi =[NSMutableDictionary dictionaryWithObjects:arr2 forKeys:arr1];

        
        NSArray *basicInfoArray = @[bi];
        
        if ([basicInfoArray writeToFile:filePath atomically:YES])
        {
            NSLog(@"用户信息初始化写入沙盒成功！[%@]", filePath);
            
            
        }
        
        
    }


}
@end
